<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>聂茹凤的高考成绩柱状图</title>
    <script src="../../js/echarts.min.js"></script>
</head>
<body>
    <div id="main" style="width:600px;height:400px"></div>
</body>
<script>
    //1.创建Echarts实例并初始化
    var myChart = echarts.init(document.getElementById("main"))
    //2. 配置option
    var option = {
        title:{
            show:true,
            text:"聂茹凤高考成绩",
        },
        xAxis:{
            type:"category", /*类目*/
            data:["语文","数学","英语","理综"], /*data 只有type取值category的时候有效*/
        },
        yAxis:{
            type:"value" ,/*数值*/
        },
        legend:{
            data:["成绩"]
        },
        series:[
            {
                type:"bar", /*柱状图*/
                name:"成绩",
                data:[145,150,123,120],
                // itemStyle:{
                //     color:"glod",
                // }
            },
        ],
    }
    //3. 将Option添加到Echarts实例中
    myChart.setOption(option)
</script>
</html>